package org.example.mapper;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.example.pojo.SleepInfo;

@Mapper
public interface SleepMapper {
    @Insert("INSERT INTO sleep_url (id,username, sleepall,sleep1,sleep2,sleep3,sleep4,voice) VALUES (#{timestamp},#{username}, #{sleepall},#{upload3},#{upload4},#{upload5},#{upload6},#{voice})")
    void insertSleepRecord(long timestamp, String username, String sleepall, String upload3, String upload4, String upload5, String upload6, String voice);


    @Select("select  voice from  sleep_url where username=#{username} and id=#{id}")
    String getVoiceByusernames(Integer id,String username);


    @Select("select  sleep1,sleep2,sleep3,sleep4 from  sleep_url where username=#{username} and id=#{id}")
    SleepInfo getYinByusernamesAndId(String id, String username);
}
